# !/usr/bin/env python
# -*- coding: utf-8 -*-

from django.db import models


# Create your models here.
# 音箱在线表
class SpeakerStatus(models.Model):
    device_type = (
        (0, 'Linux'),
        (1, 'Rtos'),
        (2, '安卓')
    )

    connect_status = (
        (0, '离线'),
        (1, '在线')
    )

    run_status = (
        (0, '未测试'),
        (1, '测试中')
    )

    device_type = models.SmallIntegerField(choices=device_type, default=0, verbose_name="电脑连接情况")
    connect_status = models.SmallIntegerField(choices=connect_status, default=0, verbose_name="电脑连接情况")
    run_status = models.SmallIntegerField(choices=run_status, default=0, verbose_name="是否处于测试中")
    # sn = models.CharField(max_length=255, verbose_name='音箱SN')
    # rom_version = models.CharField(max_length=50, verbose_name='音箱ROM版本')
    # detail = models.CharField(max_length=255, null=True, blank=True, verbose_name='音箱ROM版本')
    port = models.CharField(max_length=50, null=True, blank=True, verbose_name='端口号SN/COM')

    # 表信息声明
    class Meta:
        db_table = 'speaker_status'
        verbose_name = '音箱在线设备表'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.port
